package shujia.day06;

/*
    不同地方饮食文化不同的案例
    Person
        eat()
    SouthPerson
        eat()
    NorthPerson
        eat()

 */

class Person{
    public void eat(){

    }
}

class SouthPerson extends Person{
    @Override
    public void eat(){
        System.out.println("南方人吃米饭");
    }

    public void daMaJiang(){
        System.out.println("打麻将");
    }
}

class NorthPerson extends Person{
    @Override
    public void eat(){
        System.out.println("北方人吃面食");
    }

    public void cuZao(){
        System.out.println("搓澡");
    }
}

public class DuoTaiDemo5 {
    public static void main(String[] args) {
        Person p1 = new SouthPerson();
        p1.eat();
//        p1.daMaJiang();
//        SouthPerson sp = (SouthPerson) p1;
//        sp.daMaJiang();


        NorthPerson sp = (NorthPerson) p1;
        sp.cuZao();
    }
}
